// @ts-ignore
/* eslint-disable */
import { ModelType } from 'umi';
import * as sysDictService from '@/services/sys/sysDictService';

const SysDict: ModelType = {
  namespace: 'sysDict',

  state: {
    name: '',
  },

  effects: {

    *findPage({ payload, callback }:any, { call }:any) {
      const response = yield call(sysDictService.findPage, payload);
      if (callback) {
        callback(response)
      }
    },
    *saveObject({ payload, callback }:any, { call }:any) {
      const response = yield call(sysDictService.saveObject, payload);
      if (callback) {
        callback(response)
      }
    },
    *updateObject({ payload, callback }:any, { call }:any) {
      const response = yield call(sysDictService.updateObject, payload);
      if (callback) {
        callback(response)
      }
    },
    *fakeDelete({ payload, callback }:any, { call }:any) {
      const response = yield call(sysDictService.fakeDelete, payload);
      if (callback) {
        callback(response)
      }
    },
  },

};

export default SysDict;